ee0f20fe1747c060ef4e78d19f3b8a13f8d85125
[openwrt/openwrt.git] /
1 From patchwork Wed May 21 22:45:33 2025
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
6 X-Patchwork-Id: 14096126
7 X-Patchwork-Delegate: quic_jjohnson@quicinc.com
8 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com
9 [205.220.168.131])
10 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
11 (No client certificate requested)
12 by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4E00239570
13 for <linux-wireless@vger.kernel.org>; Wed, 21 May 2025 22:46:01 +0000 (UTC)
14 Authentication-Results: smtp.subspace.kernel.org;
15 arc=none smtp.client-ip=205.220.168.131
16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
17 t=1747867563; cv=none;
18 b=m0NU8tyG2d1pHiYNjTYhCTeGXC0pFtHNZTKxb+dc5AEzzUCa75lxPxtYFZApv1QHaLqo3lGkZ+ADhqhj/V82GA+bUeetm3hSsnyGgjbayU3IzqeO09+VPkt9sx9hdrTMlVGEI4c5881Zho41rlVW65O/SlmqRi4J/ajQzA4tiGQ=
19 ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
20 s=arc-20240116; t=1747867563; c=relaxed/simple;
21 bh=0bTV82dMwisd7nmbtolnSKswG/aTjqN0YxpAx66Oqv8=;
22 h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
23 MIME-Version:Content-Type;
24 b=jOkezej/N9fmvOtPNCGPpnPNtoQ+pAG4k1zAiw3xnL1iikk7VcJlbXDCrGUithxMZE2513zz/fsfDjXx0AMi4YT1ISljvGCw9B0dGQ5ECiFfoGLc+12nnsvqjiXI5zla6C1iX7bgtJjv/OYWzoY0TR5jI28CZWC/Pa9fT/X0duw=
25 ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
26 dmarc=pass (p=none dis=none) header.from=quicinc.com;
27 spf=pass smtp.mailfrom=quicinc.com;
28 dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
29 header.b=UqUMYAcW; arc=none smtp.client-ip=205.220.168.131
30 Authentication-Results: smtp.subspace.kernel.org;
31 dmarc=pass (p=none dis=none) header.from=quicinc.com
32 Authentication-Results: smtp.subspace.kernel.org;
33 spf=pass smtp.mailfrom=quicinc.com
34 Authentication-Results: smtp.subspace.kernel.org;
35 dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
36 header.b="UqUMYAcW"
37 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1])
38 by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
39 54LIDlKw013406;
40 Wed, 21 May 2025 22:45:53 GMT
41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
42 cc:content-transfer-encoding:content-type:date:from:in-reply-to
43 :message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
44 tYXOeicncMlFjsw5kmnB5kxC/Nrj/HibF1jgO4m8lhM=; b=UqUMYAcWWQ07Z79h
45 GESSroshxr6zIUBw3jr/ESGDCO554RYWZZh9PXJxjTRM3ceCrNHNpCAT+mqXXiWy
46 eb+l7G0W+s1l/MStBq7B43CSdKxljZtlkC/JsHk6DQjBacQzVB8qAiq3ShbR/vn7
47 ud3kzjHtYsfLvIpi+8wLTkE1in8E/CUFZ4bea866xldnrcOVEa7EuxKwKXj3sLhE
48 8n3IsPUIYGLKnEFkmWFZTXTqlEOV9lVYdTxeDAUBxII8PQIKu+dlB/UWffTFTSOd
49 aQDPK5N6y8x29E2fugyy2XBSEFskz50Jb60+kJhHFGTgl5cQw+NfymuC9SQJBWaE
50 HFZu+w==
51 Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com
52 [129.46.96.20])
53 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46rwh5cfg1-1
54 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
55 Wed, 21 May 2025 22:45:53 +0000 (GMT)
56 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
57 [10.47.209.196])
58 by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
59 54LMjqn9020293
60 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
61 Wed, 21 May 2025 22:45:52 GMT
62 Received: from ath12k-linux2.qualcomm.com (10.80.80.8) by
63 nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
64 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
65 15.2.1544.9; Wed, 21 May 2025 15:45:52 -0700
66 From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
67 To: <ath12k@lists.infradead.org>
68 CC: <linux-wireless@vger.kernel.org>,
69 Pradeep Kumar Chitrapu
70 <quic_pradeepc@quicinc.com>,
71 Muna Sinada <quic_msinada@quicinc.com>,
72 "Jeff
73 Johnson" <quic_jjohnson@quicinc.com>
74 Subject: [PATCH ath-next V14 3/9] wifi: ath12k: move HE MCS mapper to a
75 separate function
76 Date: Wed, 21 May 2025 15:45:33 -0700
77 Message-ID: <20250521224539.355985-4-quic_pradeepc@quicinc.com>
78 X-Mailer: git-send-email 2.43.0
79 In-Reply-To: <20250521224539.355985-1-quic_pradeepc@quicinc.com>
80 References: <20250521224539.355985-1-quic_pradeepc@quicinc.com>
81 Precedence: bulk
82 X-Mailing-List: linux-wireless@vger.kernel.org
83 List-Id: <linux-wireless.vger.kernel.org>
84 List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
85 List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
86 MIME-Version: 1.0
87 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
88 nalasex01a.na.qualcomm.com (10.47.209.196)
89 X-QCInternal: smtphost
90 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
91 signatures=585085
92 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIxMDIyNiBTYWx0ZWRfX0c42ymLt+PTP
93 1OuRw1LMafhFmBy7Y+zhs50WttVxoryUfqamicOcfcFB1N0ReYFgzeQ7geC/w54E8E6mzQDYeie
94 WWkPGvuIyvtCjzhBcBwz1A7W/LdsI7Od6+VlXyCuAp4pbCASB7kqVnI7Neak6mvdIQIW5khVLX7
95 r/364Kop8/BPQzOVUZf5snfx4TBCgWauiHZQBTJupIn1Tf8+NctUXB8H3QNfu8zJTLVrBA3rtt1
96 +yjeNOHom4U/t0u5Vzxu+8XctXsWHoYytfluXbsRo7WNut0MwPSY8GCm7RQ2wDQp0CzdactGb6t
97 KCMvNcpkDRjEtOdkNtf2BeVHF1yJKxuibe6qssobLjTadJRkC33xnz5E+hzF6sEZlg7JWok01h4
98 OxWFUldQYnF/eQjZYTQcgLyH91h9gWkvz0YJWKGCrg0PlxqeIFS/SQvVNs7qMnsX0qrXb7NV
99 X-Authority-Analysis: v=2.4 cv=XeWJzJ55 c=1 sm=1 tr=0 ts=682e57a1 cx=c_pps
100 a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17
101 a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=4Pgy4kl5F6fn7-PMLAkA:9
102 a=TjNXssC_j7lpFel5tvFf:22
103 X-Proofpoint-GUID: CVZHk1FyIP3eCYHbVaXVp1fjSAGIjnVJ
104 X-Proofpoint-ORIG-GUID: CVZHk1FyIP3eCYHbVaXVp1fjSAGIjnVJ
105 X-Proofpoint-Virus-Version: vendor=baseguard
106 engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40
107 definitions=2025-05-21_07,2025-05-20_03,2025-03-28_01
108 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
109 phishscore=0 clxscore=1015 mlxlogscore=999 mlxscore=0 bulkscore=0 spamscore=0
110 suspectscore=0 impostorscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0
111 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc=
112 route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000
113 definitions=main-2505210226
114
115 Refactor the HE MCS mapper functionality in
116 ath12k_mac_copy_he_cap() into a new function.
117
118 This helps improve readability, extensibility and will be used
119 when adding support for 160 MHz bandwidth in subsequent patches.
120
121 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
122
123 Co-developed-by: Muna Sinada <quic_msinada@quicinc.com>
124 Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
125 Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
126 Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
127 ---
128 drivers/net/wireless/ath/ath12k/mac.c | 22 ++++++++++++++--------
129 1 file changed, 14 insertions(+), 8 deletions(-)
130
131 --- a/drivers/net/wireless/ath/ath12k/mac.c
132 +++ b/drivers/net/wireless/ath/ath12k/mac.c
133 @@ -6786,12 +6786,24 @@ static __le16 ath12k_mac_setup_he_6ghz_c
134 return cpu_to_le16(bcap->he_6ghz_capa);
135 }
136
137 +static void ath12k_mac_set_hemcsmap(struct ath12k_band_cap *band_cap,
138 + struct ieee80211_sta_he_cap *he_cap)
139 +{
140 + struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
141 +
142 + mcs_nss->rx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
143 + mcs_nss->tx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
144 + mcs_nss->rx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
145 + mcs_nss->tx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
146 + mcs_nss->rx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
147 + mcs_nss->tx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
148 +}
149 +
150 static void ath12k_mac_copy_he_cap(struct ath12k_band_cap *band_cap,
151 int iftype, u8 num_tx_chains,
152 struct ieee80211_sta_he_cap *he_cap)
153 {
154 struct ieee80211_he_cap_elem *he_cap_elem = &he_cap->he_cap_elem;
155 - struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
156
157 he_cap->has_he = true;
158 memcpy(he_cap_elem->mac_cap_info, band_cap->he_cap_info,
159 @@ -6829,13 +6841,7 @@ static void ath12k_mac_copy_he_cap(struc
160 break;
161 }
162
163 - mcs_nss->rx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
164 - mcs_nss->tx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
165 - mcs_nss->rx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
166 - mcs_nss->tx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
167 - mcs_nss->rx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
168 - mcs_nss->tx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
169 -
170 + ath12k_mac_set_hemcsmap(band_cap, he_cap);
171 memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres));
172 if (he_cap_elem->phy_cap_info[6] &
173 IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT)